<?php

  class JooS_File_Content {
    const errorContentType = "text/html";
    
    private $contentType = null;
    private $value = "";
    private $copyrights = "";
    private $error = null;

    public function __construct($contentType = "") {
      $this->contentType = $contentType ? $contentType : self::errorContentType;
    }

    public function getContentType() {
      return $this->contentType;
    }
    
    public function setError(JooS_File_Exception $e) {
      $this->contentType = self::errorContentType;
      $this->error = $e;
    }

    public function getErrorCode() {
      return $this->error ? $this->error->getCode() : null;
    }

    public function getErrorMessage() {
      return $this->error ? $this->error->getMessage() : "";
    }

    public function setValue($value) {
      $this->value = $value;
    }
    
    public function getValue() {
      return $this->error ? null : $this->value;
    }

    public function setCopyrights($value) {
      $this->copyrights = $value;
    }
    
    public function getCopyrights() {
      return $this->error ? null : $this->copyrights;
    }
  }

?>